<?php
//------------------------------------------------------------------------------
// File               : v_gioi_thieu.php
// Modification       :
//------------------------------------------------------------------------------
// Date(yyyy.mm.dd)   Developer                       Action
//------------------------------------------------------------------------------
// 2007.03.09         NgocVQ                         Created
//------------------------------------------------------------------------------
?>
<?php
include("../fckeditor/fckeditor.php") ;

function V_GioithieuEdit(&$arrayData,$mode){
	global $arrayError;
	$fqa=CM_getParameter("fqa");
	$ulr = "?".MODUL."=gioithieu&&".ACTION."=".$mode;//htmlspecialchars($_SERVER['QUERY_STRING']);
	
	$strButtonLabel ="Ghi lại";
	$strLabel ="Sửa thông tin Giới thiệu công ty";
    $strHienThi0 = 'checked="checked"';
    $strHienThi1 = '';
	if($arrayData["hien_thi"]==1){
        $strHienThi0 = '';
		$strHienThi1 = 'checked="checked"';
	}

?>

<script language=javascript>

function validateForm() {
	if(document.f.tieu_de.value==""){
		alert("Tiêu đề không được rỗng");
		document.f.tieu_de.focus();
		return false;
	}
	return true;
}

function Focus(){
	document.f.tieu_de.focus();
}
</script>
			<?= CM_showError() ?>
<body onLoad="Focus();">
<table border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#FF9900" bordercolordark="white" width="100%">
<tbody>
<form enctype="multipart/form-data" action="<?=$ulr?>" method="post" name="f" onSubmit="return validateForm();">
<input type="hidden" name="id" value="<?=htmlspecialchars($arrayData["id"])?>" />
<input type="hidden" name="fqa" value="<?=htmlspecialchars($arrayData["fqa"])?>" />
				<tr>
				  <td colspan="2" bgcolor="#FFE59F" align="center"  class=bk12-140 ><font size="3"><strong><?=$strLabel;?></strong></font>
				  </td>
			  </tr>
				<tr>
			  		<td  width="20%" bgcolor="#FFE59F"  class=bk12-140 ><font color="#000099" size="2" face="Verdana, Arial, Helvetica, sans-serif">Tiêu đề: </font><span style="color:#FF0000;">*</span></td>
					<td width="80%">
			  			<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
			  			<input name="tieu_de" type="text" value="<?=htmlspecialchars($arrayData["tieu_de"])?>" size="80" maxlength="100" /> 
			  			</font>
			  		</td>
				</tr>
				<tr>
					<td  width="20%" bgcolor="#FFE59F"  class=bk12-140><font color="#000099" size="2" face="Verdana, Arial, Helvetica, sans-serif">Nội dung: </font></div></td>
					<td><div align="justify">						
						<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<?php

        // Automatically calculates the editor base path based on the _samples directory.
        // This is usefull only for these samples. A real application should use something like this:
        // $oFCKeditor->BasePath = '/fckeditor/' ;    // '/fckeditor/' is the default value.

        //$_SERVER : is an array containing information such as headers, paths, and script locations.
        //           The entries in this array are created by the web server.
        //           This is a automatic global, variable. This simply means that it is available in all scopes throughout a script.
        //           You don't need to do a global $_SERVER; to access it within functions or methods,
        //'PHP_SELF' : The filename of the currently executing script, relative to the document root.
        //             For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar
        //             would be /test.php/foo.bar. The __FILE__  constant contains the full path and filename of the current (i.e. included) file.
        // Lay ve duong dan chinh cua server.
        $sBasePath = $_SERVER['PHP_SELF'] ;

        // Lay ve thu muc goc cho den _sample.
        $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "run" ) ) ;
        //echo "sBasePath = $sBasePath";
        $sBasePath = $sBasePath."fckeditor/";
        $oFCKeditor = new FCKeditor('noi_dung') ;
        $oFCKeditor->BasePath    = $sBasePath ;
        $oFCKeditor->Width        = '100%' ;
        $oFCKeditor->Height        = '600' ;
        $oFCKeditor->Value       = $arrayData["noi_dung"];
        $oFCKeditor->Create() ;
?>
						</font>
					</td>
				</tr>
				<tr>
					
				</tr>
				
				<script language = 'JavaScript' >
					function backToList(){
						location = '<?="?".MODUL."=gioithieu&".ACTION."="."List"?>';
						return;
					}
				</script>
				<tr>
					<td colspan="2" align="center">
						<input name="Reset" type="reset" value=" Nhập lại " />
						<input name="Submit" type="submit" value="<?=$strButtonLabel?>" />
						<input type="button" name="back" value="Trở lại"
						onClick="javascript: return backToList();">
					</td>
				</tr>
</form>
</tbody>
</table>
</body>

<?php
}
?>
